import instance from "@/utils/request";


//1. 分页查询文章列表
export function getArticlePageList(data) {
  return instance.post("/admin/article/list", data)
}
//2. 新增文章(发布文章)
export function publishArticle(data) {
  return instance.post("/admin/article/publish", data)
}
//3. 获取文章详情
export function getArticleDetail(id) {
  return instance.post("/admin/article/detail", {id: id})
}
//4. 删除文章
export function deleteArticle(id) {
  return instance.post("/admin/article/delete", {id: id})
}

//5. 更新文章
export function updateArticle(data) {
  return instance.post("/admin/article/update", data)
}

//6. 获取分类列表
export function getCategorySelectList() {
  return instance.post("/admin/category/select/list")
}
//7. 获取标签列表
export function getTagSelectList(key) {
  return instance.post("/admin/tag/select/list", {
    key: key
  })
}

//8. 设置文章是否置顶
export function updateArticleIsTop(data) {
  return instance.post("/admin/article/isTop/update", data)
}
